<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style type="text/css">
		body{height:100vh;background: url('<{$template_dir}>home/images/images/bg.png') no-repeat 0 0;background-size: cover;margin:0;padding:0;position: relative;}
		.top{width: 100%;background: url('<{$template_dir}>home/images/images/deng.png') no-repeat 0 0;background-size: 100%;height:50px;margin:0;padding:0;position: relative;z-index: 1;}
		.center{width:1200px;position: absolute;top:0;z-index: 0;left:50%;margin-left: -600px}
		.center img{width:100%;}
		.bottom {margin-top: 575px;text-align: center;}
		.bottom button{padding:15px 10px;border-radius: 5px ;border:none;margin:0 25px;}
		.sign1{position: absolute;    top: 368px;left: 301px;color:#ff2c31;    font-size: 26px;font-weight: bold;     width: 600px;}
		.sign2{position: absolute;    top: 539px; right: 308px;
    color: #ff2c31;
    font-size: 22px;color:#b00004;    font-weight: bold;}
	</style>
    <link rel="stylesheet" href="<{$include_dir}>js/layui/css/layui.css" />
</head>
<body>
	<div class='top'></div>
	<div class='center'>
		<img src="<{$template_dir}>home/images/images/shake.png">
			<div class='sign1'>新春快乐，鸡年大吉！</div>
			<div class='sign2'>XXXXX</div>
	</div>
	<div class='bottom'> <button style="background:#ffdb11"  id="btntxt" onclick="start()">开抽</button><!--<button style="background:#fe8e0b">停止</button>--> <span class='xc' style="display:none"><button style='background:#85000c' onclick="remove_peron()">下次不带他</button></span></div>
</body>

<script src="<{$template_dir}>admin/js/jquery-1.7.2.js"></script>
<script type="text/javascript">

var xinm = new Array();
<{foreach key=k item=v from=$content}>
	xinm.push("<{$v}>");	
	
<{/foreach}>
var phone = new Array();
<{foreach key=k item=v from=$mobile}>
	phone.push("<{$v}>");	
	
<{/foreach}>

   
  


	var nametxt = $('.sign1');
	var phonetxt = $('.sign2');
	var pcount = xinm.length-1;//参加人数
	var runing = true;
	var td = 10;//内定中奖,从最小奖开始，共10个名额
	var num = 0;
	var t;
	//开始停止
	function start() {
		if (runing) {
			runing = false;
			$('#btntxt').removeClass('start').addClass('stop');
			$('#btntxt').html('停止');
			$('.xc').css('display','none');
			startNum()
		} else {
			runing = true;
			$('#btntxt').removeClass('stop').addClass('start');
			$('#btntxt').html('开始');
			$('.xc').css('display','inline');
			stop();
			
		}
	}
	//循环参加名单
	function startNum() {
		num = Math.floor(Math.random() * pcount);
		nametxt.html(xinm[num]);
		phonetxt.html(phone[num]);
		t = setTimeout(startNum, 0);
	}
	//停止跳动
	function stop() {
		pcount = xinm.length-1;
		clearInterval(t);
		t = 0;
	}
	//下次不带他
	function remove_peron()
	{
		result = phonetxt.html();
		for(var i=0;i<phone.length;i++){
			if(phone[i]==result)
			{
				xinm.splice(i,1);
				phone.splice(i,1);				
			}
        }
		$.ajax({  
                    type : "POST",  //提交方式  
                    url : "<{$yu_ming}>index.php?o=activity&t=Winning",//路径  
                    data : {  
                        "phone" : result
                    },//数据，这里使用的是Json格式进行传输  
                    success : function(result) {//返回数据根据结果进行相应的处理  
                        alert('ok');
                    }  
       });
	}

  	
    




</script>

</html>